<template>
  <div>
      <h4>修改汽车</h4>
      编号：{{carObj.id}}<br>
      品牌：{{carObj.type}}<br>
      价格:<input type="text" v-model="carObj.price"><br>
      产地：{{carObj.address}}<br>
      <input type="button" value="修改" @click="updateCar()">
  </div>
</template>

<script>
export default {
   props:["carObj"],

    methods:{
       async updateCar(){
           if(this.carObj.price != null){
        var info =  await this.ajax.getSubmit("/project/car/update",this.carObj);
              if(info == "ok"){
                  alert("修改成功");
                   this.$emit("findByItem",{page:1});
                  
              }
              } else{
                  alert("请填写修改的价格");
              }
        }
    }
}
</script>

<style>

</style>